package com.wyzz.hr.action;

import java.util.Map;

import com.wyzz.hr.base.BaseAction;
import com.wyzz.hr.util.DatabaseSysConfigManager;
import com.wyzz.hr.util.SysConfigManager;

public class ConfigRecruit extends BaseAction {

	public ConfigRecruit() {
	}

	public String showRecruitConfig() throws Exception {
		if (!hasAuth(961, new int[0])) {
			addErrorInfo("\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u65E0\u6743\u8FDB\u5165\u8BE5\u9875\u9762\uFF01");
			return "noauth";
		} else {
			Map dbMap = dbManager.getProperties();
			sys_recruit_blacklist_outdate = (String) dbMap
					.get("sys.recruit.blacklist.outdate");
			return "success";
		}
	}

	public String updateRecruitConfig() throws Exception {
		if (!hasAuth(961, new int[0])) {
			addErrorInfo("\u5BF9\u4E0D\u8D77\uFF0C\u60A8\u65E0\u6743\u8FDB\u5165\u8BE5\u9875\u9762\uFF01");
			return "noauth";
		} else {
			Map dbMap = dbManager.getProperties();
			dbManager.setProperty("sys.recruit.blacklist.outdate",
					sys_recruit_blacklist_outdate);
			return "success";
		}
	}

	public String getSys_recruit_blacklist_outdate() {
		return sys_recruit_blacklist_outdate;
	}

	public void setSys_recruit_blacklist_outdate(
			String sys_recruit_blacklist_outdate) {
		this.sys_recruit_blacklist_outdate = sys_recruit_blacklist_outdate;
	}

	private static final long serialVersionUID = 1L;
	private String sys_recruit_blacklist_outdate;
	private static SysConfigManager dbManager = DatabaseSysConfigManager
			.getInstance();

}
